﻿@using HYBY.WebFrameWork.Mvc;
@{
    //success messages
    var successMessages = new List<string>();
    if (TempData[string.Format("tp.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(TempData[string.Format("tp.notifications.{0}", NotifyType.Success)] as IList<string>);
    }
    if (ViewData[string.Format("tp.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(ViewData[string.Format("tp.notifications.{0}", NotifyType.Success)] as IList<string>);
    }


    //error messages
    var errorMessages = new List<string>();
    if (TempData[string.Format("tp.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(TempData[string.Format("tp.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
    if (ViewData[string.Format("tp.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(ViewData[string.Format("tp.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
}

@foreach (var message in successMessages)
{
    <div class="alert alert-success">
        <strong>操作成功!</strong> @message
    </div>
}
@foreach (var message in errorMessages)
{
    <div class="alert alert-danger alert-dismissible">
        <strong><i class="fa fa-warning"></i>错误!</strong>@message
    </div>
}
